package com.cenluan.user;

import com.jfinal.plugin.activerecord.Model;

/**
 * 用户
 * 
 * @author peak
 * 
 */
public class User extends Model<User> {

	private static final long serialVersionUID = 1L;

	public static final User dao = new User();

	/**
	 * 根据小米的用户ID获取用户，即米聊号
	 * 
	 * @param userId
	 * @return
	 */
	public User findByMiUserId(Integer userId) {
		return findFirst("select * from t_user where miUserId=?", userId);
	}

	/**
	 * 根据QQopenid获取用户
	 * 
	 * @param userId
	 * @return
	 */
	public User findByQqOpenId(String qqOpenId) {
		return findFirst("select * from t_user where qqOpenId=?", qqOpenId);
	}
}
